<div class="card mt-3">
    <div class="card-header">
        站点资料
    </div>
    <div class="card-body">
        <div class="col-12 col-md-6">
            <x-form title='站点名称' name='title' required value="{{ $site['title']??'' }}"></x-form>
            <x-form title='域名' name='domain' required value="{{ $site['domain'] ??'' }}"></x-form>
        </div>
    </div>
    <div class="card mt-3">
        <div class="card-header">
            默认模块
        </div>

        <div class="card-body">
            <div class="row">

                @foreach(user()->group->modules as $index=>$module)
                    <div class="col-6 col-sm-4">
                        <div class="card">
                            <div class="card-body  d-flex flex-column justify-content-center align-items-center">
                                <img src="{{$module['preview']}}" class="rounded-circle mb-3" style="width:45px">
                                {{$module['title']}}
                                <span class="text-secondary small text-center">{{$module['description']}}</span>
                            </div>
                            <div class="card-footer text-muted d-flex justify-content-center align-items-center">
                                <label>
                                    <input type="radio" name="module_id" value="{{$module['id']}} "
                                    {{($module['id']===($site['module_id']?:'') ? 'checked' : '') ? 'checked' : ($index==0 ? 'checked' :'')}} hidden>
                                    <span class="btn btn-secondary btn-sm">设置为默认</span>
                                </label>

                            </div>
                        </div>
                    </div>

                @endforeach
            </div>
        </div>

    </div>
</div>

<button class="btn btn-primary mt-3">保存</button>
@push('styles')
    <style>
    input[name='module_id']:checked+span{
        background: red;
    }
    </style>
@endpush
